<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>


    <script>
        var ua = navigator.userAgent;
        if (/Chrome/i.test(ua)) {
            console.log("是谷歌浏览器")
        } else if (/Firefox/i.test(ua)) {
            console.log("是火狐浏览器")
        } else if (/MSIE/i.test(ua)) {
            console.log("是IE浏览器")
        } else if ("ActiveXObject" in window) {
            console.log("是IE11")
        }
    </script>
</body>

</html>